package chances.epg.ui.taglib.html;

import javax.servlet.jsp.JspException;

import org.apache.commons.lang.StringUtils;


import chances.epg.ui.taglib.model.Rect;

@SuppressWarnings("serial")
public class PosterTag extends ImgTag {
	private String icon;
	private String tips;
	private String iconClass;
	private String tipsClass;
	private Rect iconRect = new Rect();

	private Rect tipsRect = new Rect();;

	@Override
	public void doAfterStart() throws JspException {
		if (StringUtils.isEmpty(this.getContext())) {
			String name =  this.epgPageContext.getResourcePath();
			super.setContext(name);
		}
		super.doAfterStart();
		this.vm = "poster";
	

		iconRect =this.nativeRect.getChildRect(iconRect, true);
		tipsRect = this.nativeRect.getChildRect(tipsRect, true);
	}

	@Override
	public void release() {
		this.icon = null;
		this.tips = null;
		this.iconClass = null;
		this.tipsClass = null;
		this.iconRect = new Rect();
		this.tipsRect = new Rect();
		super.release();
	}

	public String getIcon() {
		return icon;
	}

	public String getTips() {
		return tips;
	}

	public String getIconClass() {
		return iconClass;
	}

	public String getTipsClass() {
		return tipsClass;
	}

	public void setIconRectStyle(String iconRectStyle) {
		this.iconRect = Rect.parseStyle(iconRectStyle);
	}

	public void setTipsRectStyle(String tipsRectStyle) {
		this.tipsRect = Rect.parseStyle(tipsRectStyle);
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public void setTips(String tips) {
		this.tips = tips;
	}

	public void setIconClass(String iconClass) {
		this.iconClass = iconClass;
	}

	public void setTipsClass(String tipsClass) {
		this.tipsClass = tipsClass;
	}

	public Rect getIconRect() {
		return iconRect;
	}

	public Rect getTipsRect() {
		return tipsRect;
	}

}
